Particle Cloud
Using the same setup as detailed_look.jl or example2(), here we simulate a point cloud getting advected by the flow field. For additional documentation e.g. see : 1, 2, 3, 4
1. Import Software
using IndividualDisplacements, OrdinaryDiffEq, Statistics
p=dirname(pathof(IndividualDisplacements))
include(joinpath(p,"../examples/recipes_plots.jl"))
include(joinpath(p,"../examples/example123.jl"));2. Setup Problem
๐,ฮ=example2_setup()
ii1=5:5:40; ii2=5:5:25
x=vec([x-0.5 for x in ii1, y in ii2])
y=vec([y-0.5 for x in ii1, y in ii2])
xy=transpose([x y])
๐.๐[:] = [0.0,2998*3600.0]
solv(prob) = solve(prob,Tsit5(),reltol=1e-6,abstol=1e-6)
tr = DataFrame([fill(Int, 1) ; fill(Float64, 3)], [:ID, :x, :y, :t])
๐ผ = Individuals{Float64}(๐=xy[:,:], ๐ด=tr, ๐=collect(1:size(xy,2)),
๐ = dxy_dt, โซ = solv, ๐ง = postprocess_xy, ๐=๐);3. Compute Trajectories
๐=(0.0,๐ผ.๐.๐[2])
โซ!(๐ผ,๐)2ร40 Array{Float64,2}:
5.91182 10.5953 11.087 12.6622 โฆ 37.9639 29.12 30.6396
-12.3525 124.028 487.117 478.34 8.68514 19.2392 22.44154. Display results
๐ผ.๐ด.lon=5000*๐ผ.๐ด.x
๐ผ.๐ด.lat=5000*๐ผ.๐ด.y
plt=PlotBasic(๐ผ.๐ด,size(xy,2),100000.0)
Compare with trajectory output from MITgcm
#df=read_flt(joinpath(p,"../examples/flt_example/"),Float32)
#ref=PlotBasic(df,size(xy,2),100000.0)This page was generated using Literate.jl.